package com.hoshiicloud.suppplier.feign;

import com.hoshiicloud.common.rpc.Response;
import com.hoshiicloud.user.dto.supppiler.*;
import com.hoshiicloud.user.param.supppiler.*;
import com.hoshiicloud.suppplier.feign.hystrix.HystrixUsersServiceFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

/**
 * @Author:campchen
 * @Date:Created in 上午 11:48 2019/7/30
 * @PACKAGENAME com.hoshiicloud.suppplier.feign
 * @Description
 */
@FeignClient(name = "hoshiicloud-user", fallback = HystrixUsersServiceFeignFallback.class)
@Repository
public interface IUsersService {
    /**
     * 租户
     */
    @GetMapping(value = "/company/company/{id}")
    Response getById(@PathVariable("id") Long id);

    @GetMapping(value = "/company/department/{id}")
    Response getComDepartmentsById(@PathVariable("id") Long id);

    @GetMapping(value = "/company/attachtype/{id}")
    Response getAttachById(@PathVariable("id") Long id);

    @GetMapping(value = "/company/settele/{id}")
    Response getSetteleById(@PathVariable("id") Long id);

    @GetMapping(value = "/rbac/member/{id}")
    Response getMemberById(@PathVariable("id") Long id);

    @GetMapping(value = "/rbac/member/getMemberByMobile")
    Response<Member> getMemberByMobile(@RequestParam("companyId") Long companyId,@RequestParam("mobile") String mobile);

    @PostMapping(value = "/rbac/member/save")
    Response<Long> save(@RequestBody Member member);

    @GetMapping("/company/orgtype/query/{orgType}")
    Response selectOrganizationTypeByOrgType(@PathVariable("orgType") Integer orgType);

    @PostMapping("/company/attachtype/query/id")
    Response selectAttachmentTypeByCategoryIdOrOrganizationId(@RequestParam("categoryIds") List<Long> categoryIds, @RequestParam("organizationTypeId") Long organizationTypeId);
    /**租户*/


    /**
     * 平台
     */
    @GetMapping(value = "/platform/platform/{id}")
    Response<PlatformDTO> getPlatformById(@PathVariable("id") Long id);
    /**平台*/


    /**
     * 店铺
     */
    @GetMapping(value = "/store/plat-store/{id}")
    Response<PlatStoreDTO> getPlatStoreById(@PathVariable("id") Long id);
    /**店铺*/


    /**
     * 租户供应商
     */
    //新增租户供应商
    @PostMapping(value = "/organization/com-organization/save")
    Response<String> saveCompanyOrganization(@RequestBody ComOrganizationAddParam comOrganizationAddParam);

    //分页获取租户供应商列表
    @PostMapping(value = "/organization/com-organization/getPage")
    Response getPage(@RequestBody ComOrganizationQueryParam comOrganizationQueryParam);

    //根据id查询租户供应商详情
    @GetMapping(value = "/organization/com-organization/{id}")
    Response<ComOrganizationDTO> selectCompanyOrganization(@PathVariable("id") Long id);

    //根据id修改租户供应商审核状态status
    @PutMapping(value = "/organization/com-organization/comApproval")
    Response comApproval(@RequestParam("id") Long id, @RequestParam("status") Integer status);

    //修改租户供应商信息
    @PutMapping(value = "/organization/com-organization/update")
    Response update(@RequestBody ComOrganizationUpdateParam comOrganizationUpdateParam);

    @PostMapping(value = "/organization/com-organization-category/getPage")
    Response getPageCategory(@RequestBody ComOrganizationCategoryQueryParam param);


    //保存租户供应商经营品类
    @PostMapping(value = "/organization/com-organization-category/save")
    Response save(@RequestBody @Valid ComOrganizationCategoryAddParam param);

    //批量保存租户供应商经营品类
    @PostMapping(value = "/organization/com-organization-category/insertCategory4ComOrganization")
    Response insertCategory4ComOrganization(@RequestBody  List<ComOrganizationCategoryDTO> comOrganizationCategories);

    @PostMapping(value = "/organization/com-organization-attach/getPage")
    Response getPageAttach(@RequestBody ComOrganizationAttachQueryParam param);

    //保存租户供应商附件
    @PostMapping(value = "/organization/com-organization-attach/save")
    Response saveCompanyOrganizationAttach(@RequestBody ComOrganizationAttachDTO comOrganizationAttachDTO);

    //批量保存租户供应商附件
    @PostMapping(value = "/organization/com-organization-attach/insertAttach4ComOrganization")
    Response insertAttach4ComOrganization(@RequestBody List<ComOrganizationAttachDTO> list);

    //新增租户供应商部门
    @PostMapping(value = "/organization/com-organization-departmentes/save")
    Response<String> saveCompanyOrganizationDepartmentes(@RequestBody ComOrganizationDepartmentesAddParam comOrganizationDepartmentesAddParam);

    //新增租户供应商用户
    @PostMapping(value = "/organization/com-organization-users/save")
    Response<String> saveCompanyOrganizationUsers(@RequestBody ComOrganizationUsersAddParam comOrganizationUsersAddParam);

    //新增租户部门与人员的关联表
    @PostMapping(value = "/organization/com-organization-departmentes-users/save")
    Response saveCompanyOrganizationDepartmentesUsers(@RequestBody ComOrganizationDepartmentesUsersAddParam comOrganizationDepartmentesUsersAddParam);


    //批量删除附件
    @PostMapping(value = "/organization/com-organization-attach/deleteByIds")
    Response deleteAttachByIds(@RequestBody List<Long> ids);

    //批量删除经营领域
    @PostMapping(value = "/organization/com-organization-category/deleteByIds")
    Response deleteCategoryByIds(@RequestBody List<Long> ids);

    //删除供应商基础信息
    @PostMapping(value = "/organization/com-organization/deleteById")
    Response deleteByComId(@RequestParam("id") Long id);

    //根据id逻辑删除租户供应商部门
    @GetMapping(value = "/organization/com-organization-departmentes/delete/{id}")
    Response deleteByDepartmentId(@PathVariable("id") Long id);

    //根据id逻辑删除租户供应商用户
    @GetMapping(value = "/organization/com-organization-users/delete/{id}")
    Response deleteByUsersId(@PathVariable("id") Long id);
    //获取某个租户用户所关联的供应商列表
    @GetMapping("/organization/com-organization/selectOrganizationByMemberId/{memberId}")
    Response selectOrganizationByMemberId(@PathVariable("memberId") Long memberId);

    @GetMapping("/organization/com-organization/find/{name}")
    Response findByName(@PathVariable("name") String name);

    /**租户供应商*/


    /**
     * 平台供应商
     */
    @PostMapping(value = "/organization/plat-organization/save")
    Response<String> savePlatformOrganization(@RequestBody PlatOrganizationAddParam platOrganizationAddParam);

    //分页获取平台供应商列表
    @PostMapping(value = "/organization/plat-organization/getPage")
    Response getPage(@RequestBody PlatOrganizationQueryParam platOrganizationQueryParam);

    //根据id查询平台供应商详情
    @GetMapping(value = "/organization/plat-organization/{id}")
    Response<PlatOrganizationDTO> selectPlatformOrganization(@PathVariable("id") Long id);

    //根据id修改平台供应商审核状态status
    @PutMapping(value = "/organization/plat-organization/comApproval")
    Response platApproval(@RequestParam("id") Long id, @RequestParam("status") Integer status);

    //修改平台供应商信息
    @PutMapping(value = "/organization/plat-organization/update")
    Response update(@RequestBody PlatOrganizationUpdateParam platOrganizationUpdateParam);

    //保存平台供应商经营品类
    @PostMapping(value = "/organization/plat-organization-category/save")
    Response save(@RequestBody @Valid PlatOrganizationCategoryAddParam param);

    //批量保存平台供应商经营品类
    @PostMapping(value = "/organization/plat-organization-category/insertCategory4PlatOrganization")
    Response insertCategory4PlatOrganization(@RequestBody  List<PlatOrganizationCategoryDTO> platOrganizationCategories);

    //新增平台供应商附件
    @PostMapping(value = "/organization/plat-organization-attachment/save")
    Response savePlatformOrganizationAttach(@RequestBody PlatOrganizationAttachmentDTO platOrganizationAttachmentDTO);

    //新增平台供应商附件
    @PostMapping(value = "/organization/plat-organization-attachment/insertAttach4PlatOrganization")
    Response insertAttach4PlatOrganization(@RequestBody List<PlatOrganizationAttachmentDTO> list);

    //新增平台供应商部门
    @PostMapping(value = "/organization/plat-organization-departmentes/save")
    Response<String> savePlatformOrganizationDepartmentes(@RequestBody PlatOrganizationDepartmentesAddParam platOrganizationDepartmentesAddParam);

    //新增平台供应商用户
    @PostMapping(value = "/organization/plat-organization-users/save")
    Response<String> savePlatformOrganizationUsers(@RequestBody PlatOrganizationUsersAddParam platOrganizationUsersAddParam);

    //新增平台供应商部门与人员的关联表
    @PostMapping(value = "/organization/plat-organization-departmentes-users/save")
    Response savePlatformOrganizationDepartmentesUsers(@RequestBody PlatOrganizationDepartmentesUsersAddParam platOrganizationDepartmentesUsersAddParam);
    /**平台供应商*/


    /**
     * 店铺供应商
     */
    @PostMapping(value = "/organization/store-organization/save")
    Response<String> saveStoreOrganization(@RequestBody StoreOrganizationAddParam storeOrganizationAddParam);

    //分页获取店铺供应商列表
    @PostMapping(value = "/organization/store-organization/getPage")
    Response getPage(@RequestBody StoreOrganizationQueryParam storeOrganizationQueryParam);

    //根据id查询店铺供应商详情
    @GetMapping(value = "/organization/store-organization/{id}")
    Response<StoreOrganizationDTO> selectStoreOrganization(@PathVariable("id") Long id);

    //根据id修改店铺供应商审核状态status
    @PutMapping(value = "/organization/store-organization/comApproval")
    Response storeApproval(@RequestParam("id") Long id, @RequestParam("status") Integer status);

    //修改店铺供应商信息
    @PutMapping(value = "/organization/store-organization/update")
    Response update(@RequestBody StoreOrganizationUpdateParam storeOrganizationUpdateParam);

    //保存店铺供应商经营品类
    @PostMapping(value = "/organization/store-organization-category/save")
    Response save(@RequestBody @Valid StoreOrganizationCategoryAddParam param);

    //批量保存店铺供应商经营品类
    @PostMapping(value = "/organization/store-organization-category/insertCategory4StoreOrganization")
    Response insertCategory4StoreOrganization(@RequestBody  List<StoreOrganizationCategoryDTO> storeOrganizationCategories);


    //保存店铺供应商附件
    @PostMapping(value = "/organization/store-organization-attachment/save")
    Response saveStoreOrganizationAttach(@RequestBody StoreOrganizationAttachmentDTO storeOrganizationAttachmentDTO);

    //批量保存店铺供应商附件
    @PostMapping(value = "/organization/store-organization-attachment/insertAttach4StoreOrganization")
    Response insertAttach4StoreOrganization(@RequestBody List<StoreOrganizationAttachmentDTO> list);

    //新增店铺供应商部门
    @PostMapping(value = "/organization/store-organization-departmentes/save")
    Response<String> saveStoreOrganizationDepartmentes(@RequestBody StoreOrganizationDepartmentesAddParam storeOrganizationDepartmentesAddParam);

    //新增店铺供应商用户
    @PostMapping(value = "/organization/store-organization-users/save")
    Response<String> saveStoreOrganizationUsers(@RequestBody StoreOrganizationUsersAddParam storeOrganizationUsersAddParam);

    //新增店铺供应商部门与人员的关联表
    @PostMapping(value = "/organization/store-organization-departmentes-users/save")
    Response saveStoreOrganizationDepartmentesUsers(@RequestBody StoreOrganizationDepartmentesUsersAddParam storeOrganizationDepartmentesUsersAddParam);
    /**店铺供应商*/
}
